Optimal. Leaf size=121 \[ \frac {a^2 x}{b \left (a^2+b^2\right )}+\frac {b x}{a^2+b^2}+\frac {2 a^3 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b \left (a^2+b^2\right )^{3/2} d}+\frac {a \text {sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac {b \tanh (c+d x)}{\left (a^2+b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {2981, 2686, 8,
3554, 2814, 2739, 632, 210} \begin {gather*} -\frac {b \tanh (c+d x)}{d \left (a^2+b^2\right )}+\frac {a \text {sech}(c+d x)}{d \left (a^2+b^2\right )}+\frac {a^2 x}{b \left (a^2+b^2\right )}+\frac {b x}{a^2+b^2}+\frac {2 a^3 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b d \left (a^2+b^2\right )^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 210
Rule 632
Rule 2686
Rule 2739
Rule 2814
Rule 2981
Rule 3554
Rubi steps
\begin {align*} \int \frac {\sinh (c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx &=-\frac {a \int \text {sech}(c+d x) \tanh (c+d x) \, dx}{a^2+b^2}+\frac {a^2 \int \frac {\sinh (c+d x)}{a+b \sinh (c+d x)} \, dx}{a^2+b^2}+\frac {b \int \tanh ^2(c+d x) \, dx}{a^2+b^2}\\ &=\frac {a^2 x}{b \left (a^2+b^2\right )}-\frac {b \tanh (c+d x)}{\left (a^2+b^2\right ) d}-\frac {a^3 \int \frac {1}{a+b \sinh (c+d x)} \, dx}{b \left (a^2+b^2\right )}+\frac {b \int 1 \, dx}{a^2+b^2}+\frac {a \text {Subst}(\int 1 \, dx,x,\text {sech}(c+d x))}{\left (a^2+b^2\right ) d}\\ &=\frac {a^2 x}{b \left (a^2+b^2\right )}+\frac {b x}{a^2+b^2}+\frac {a \text {sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac {b \tanh (c+d x)}{\left (a^2+b^2\right ) d}+\frac {\left (2 i a^3\right ) \text {Subst}\left (\int \frac {1}{a-2 i b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (i c+i d x)\right )\right )}{b \left (a^2+b^2\right ) d}\\ &=\frac {a^2 x}{b \left (a^2+b^2\right )}+\frac {b x}{a^2+b^2}+\frac {a \text {sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac {b \tanh (c+d x)}{\left (a^2+b^2\right ) d}-\frac {\left (4 i a^3\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2+b^2\right )-x^2} \, dx,x,-2 i b+2 a \tan \left (\frac {1}{2} (i c+i d x)\right )\right )}{b \left (a^2+b^2\right ) d}\\ &=\frac {a^2 x}{b \left (a^2+b^2\right )}+\frac {b x}{a^2+b^2}+\frac {2 a^3 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b \left (a^2+b^2\right )^{3/2} d}+\frac {a \text {sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac {b \tanh (c+d x)}{\left (a^2+b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 96, normalized size = 0.79 \begin {gather*} \frac {\frac {c+d x}{b}+\frac {2 a^3 \text {ArcTan}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2-b^2}}\right )}{b \left (-a^2-b^2\right )^{3/2}}+\frac {\text {sech}(c+d x) (a-b \sinh (c+d x))}{a^2+b^2}}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.44, size = 125, normalized size = 1.03
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}-\frac {2 a^{3} \arctanh \left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}-\frac {2 \left (b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{\left (a^{2}+b^{2}\right ) \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}}{d}\) | \(125\) |
default | \(\frac {\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}-\frac {2 a^{3} \arctanh \left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}-\frac {2 \left (b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{\left (a^{2}+b^{2}\right ) \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}}{d}\) | \(125\) |
risch | \(\frac {x}{b}+\frac {2 a \,{\mathrm e}^{d x +c}+2 b}{d \left (a^{2}+b^{2}\right ) \left (1+{\mathrm e}^{2 d x +2 c}\right )}+\frac {a^{3} \ln \left ({\mathrm e}^{d x +c}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}+a^{4}+2 a^{2} b^{2}+b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d b}-\frac {a^{3} \ln \left ({\mathrm e}^{d x +c}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}-a^{4}-2 a^{2} b^{2}-b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d b}\) | \(181\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.46, size = 141, normalized size = 1.17 \begin {gather*} -\frac {a^{3} \log \left (\frac {b e^{\left (-d x - c\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-d x - c\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} b + b^{3}\right )} \sqrt {a^{2} + b^{2}} d} + \frac {2 \, {\left (a e^{\left (-d x - c\right )} - b\right )}}{{\left (a^{2} + b^{2} + {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, d x - 2 \, c\right )}\right )} d} + \frac {d x + c}{b d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 459 vs.
\(2 (118) = 236\).
time = 0.44, size = 459, normalized size = 3.79 \begin {gather*} \frac {{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x \cosh \left (d x + c\right )^{2} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x \sinh \left (d x + c\right )^{2} + 2 \, a^{2} b^{2} + 2 \, b^{4} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x + {\left (a^{3} \cosh \left (d x + c\right )^{2} + 2 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a^{3} \sinh \left (d x + c\right )^{2} + a^{3}\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (d x + c\right )^{2} + b^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right ) + a\right )}}{b \cosh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) + 2 \, {\left (b \cosh \left (d x + c\right ) + a\right )} \sinh \left (d x + c\right ) - b}\right ) + 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right ) + 2 \, {\left (a^{3} b + a b^{3} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sinh {\left (c + d x \right )} \tanh ^{2}{\left (c + d x \right )}}{a + b \sinh {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 128, normalized size = 1.06 \begin {gather*} -\frac {\frac {a^{3} \log \left (\frac {{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} b + b^{3}\right )} \sqrt {a^{2} + b^{2}}} - \frac {d x + c}{b} - \frac {2 \, {\left (a e^{\left (d x + c\right )} + b\right )}}{{\left (a^{2} + b^{2}\right )} {\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.00, size = 468, normalized size = 3.87 \begin {gather*} \frac {\frac {2\,b}{d\,\left (a^2+b^2\right )}+\frac {2\,a\,{\mathrm {e}}^{c+d\,x}}{d\,\left (a^2+b^2\right )}}{{\mathrm {e}}^{2\,c+2\,d\,x}+1}+\frac {x}{b}+\frac {2\,\mathrm {atan}\left (\left ({\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (\frac {2\,a^3}{b^3\,d\,\left (a^2\,b+b^3\right )\,\sqrt {a^6}\,\left (a^2+b^2\right )}+\frac {2\,\left (a\,b^3\,d\,\sqrt {a^6}+a^3\,b\,d\,\sqrt {a^6}\right )}{a^2\,b^2\,\left (a^2\,b+b^3\right )\,\sqrt {-b^2\,d^2\,{\left (a^2+b^2\right )}^3}\,\sqrt {-a^6\,b^2\,d^2-3\,a^4\,b^4\,d^2-3\,a^2\,b^6\,d^2-b^8\,d^2}}\right )-\frac {2\,\left (b^4\,d\,\sqrt {a^6}+a^2\,b^2\,d\,\sqrt {a^6}\right )}{a^2\,b^2\,\left (a^2\,b+b^3\right )\,\sqrt {-b^2\,d^2\,{\left (a^2+b^2\right )}^3}\,\sqrt {-a^6\,b^2\,d^2-3\,a^4\,b^4\,d^2-3\,a^2\,b^6\,d^2-b^8\,d^2}}\right )\,\left (\frac {b^4\,\sqrt {-a^6\,b^2\,d^2-3\,a^4\,b^4\,d^2-3\,a^2\,b^6\,d^2-b^8\,d^2}}{2}+\frac {a^2\,b^2\,\sqrt {-a^6\,b^2\,d^2-3\,a^4\,b^4\,d^2-3\,a^2\,b^6\,d^2-b^8\,d^2}}{2}\right )\right )\,\sqrt {a^6}}{\sqrt {-a^6\,b^2\,d^2-3\,a^4\,b^4\,d^2-3\,a^2\,b^6\,d^2-b^8\,d^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________